﻿package com.obas.model.type
{
	import com.ease.common.enums.TextualEnum;
	import com.ease.lang.Enum;
	import com.ease.lang.EnumConstants;
	import com.obas.model.type.TimeDimensionType;

	[Bindable]
	[RemoteClass(alias="com.obas.model.type.TimeDimensionType")]

	public class TimeDimensionType extends Enum
	{
		/* static init */
		{ initEnum(TimeDimensionType); }

		/* Constants */
		public static const MINUTE:TimeDimensionType = new TimeDimensionType("MINUTE", "分", "MINUTE");
		public static const HOUR:TimeDimensionType = new TimeDimensionType("HOUR", "时", "HOUR");
		public static const DAY:TimeDimensionType = new TimeDimensionType("DAY", "天", "DAY");
		public static const WEEK:TimeDimensionType = new TimeDimensionType("WEEK", "周", "WEEK");
		public static const MONTH:TimeDimensionType = new TimeDimensionType("MONTH", "月", "MONTH");
		public static const SEASON:TimeDimensionType = new TimeDimensionType("SEASON", "季", "SEASON");
		public static const YEAR:TimeDimensionType = new TimeDimensionType("YEAR", "年", "YEAR");

		private var _text:String;
		private var _code:String;

		/*public*/ function TimeDimensionType(name:String=null ,text:String=null ,code:String=null) {
			super.name = name;
			this._text = text;
			this._code = code;
		}

		public function get text():String  { return this._text; }
		public function get code():String  { return this._code; }

		/* constant query */
		public static function getEnumConstants():Array {
			return Enum.getEnumConstants(TimeDimensionType);
		}

		public static function get(constantName:String, caseSensitive:Boolean = false):TimeDimensionType {
			return TimeDimensionType(Enum.get(TimeDimensionType, constantName, caseSensitive));
		}
	}
}